FROM crpi-58vbzaqj19qw8ilj.cn-beijing.personal.cr.aliyuncs.com/library/openjdk:17-slim
WORKDIR /app

COPY target/deepseek-server-0.0.1-SNAPSHOT.jar app.jar

# Install required tools
RUN apt-get update && \
    apt-get install -y \
    android-tools-adb \
    curl \
    unzip \
    udev

# Download and install HDC
RUN curl -o hdc.zip -L https://developer.harmonyos.com/cn/develop/deveco-studio#download \
    && unzip hdc.zip \
    && mv hdc /usr/local/bin/ \
    && chmod +x /usr/local/bin/hdc \
    && rm hdc.zip

# Create required directories
RUN mkdir -p /app/screenshots

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.jar"]